home *** CD-ROM | disk | FTP | other *** search
/ PC Pro 2 (Special) / PCPro-2b.iso / Demos / Macromedia / CourseBuilder / CourseBuilderInstaller.exe / Disk1 / data1.cab / Dreamweaver-unInstalled / Configuration / Commands / Condition Editor.js < prev    next >
Encoding:
JavaScript  |  1999-12-06  |  20.7 KB  |  642 lines

  1. // Copyright 1998,1999 Macromedia, Inc. All rights reserved.
  2.  
  3. //*************** GLOBALS VARS *****************
  4.  
  5. var HELP_DOC = HELP_cmdConditionEditor;
  6.  
  7. var MENUDATA_stdExprTypes = new Array("knowledge","segment","tag","javascript");
  8. var MENUDATA_allExprTypes = new Array("knowledge","segment","tag","javascript",
  9.       "boolean","string","number");
  10. var MENUDATA_ordExprTypes = new Array("knowledge","segment","tag","javascript","ordinal");
  11. var MENUDATA_numExprTypes = new Array("knowledge","segment","tag","javascript","number");
  12. var MENUDATA_strExprTypes = new Array("knowledge","segment","tag","javascript","string");
  13. var MENUDATA_boolExprTypes = new Array("knowledge","segment","tag","javascript","boolean");
  14. var MENUDATA_ordCompTypes = new Array("==", "!=");
  15. var MENUDATA_numCompTypes = new Array("==", "!=", ">", "<", ">=", "<=");
  16. var MENUDATA_strCompTypes = new Array("==", "!=","contains", "!contains");
  17.  
  18. var PROP_autoAddCondition = true;
  19. var PROP_autoNameCondition = true;
  20.  
  21. // attainInfo
  22. var LABELDATA_elemTypes = new Array(
  23.       "inpt","ibtn","hota","text","textComp","sldr","sldrRnge","timr","timrTrig",
  24.       "both","drag","targ","dragTarg");
  25.  
  26. // tagInfo
  27. var MENUDATA_tagNames = new Array(
  28.       "LAYER","DIV","SPAN","IMG","FORM","INPUT/CHECKBOX","INPUT/RADIO",
  29.       "INPUT/TEXT","TEXTAREA","INPUT/PASSWORD","SELECT");
  30.       
  31. // propEditor
  32. var MENUDATA_boolOps = new Array("&&", "||");
  33. var MENUDATA_allCompTypes = new Array(
  34.       "==", "!=", ">", "<", ">=", "<=","contains", "!contains");
  35. var MENUDATA_boolVals = new Array("true", "false");
  36.  
  37.  
  38. // Interface variables
  39. var COND_NAME = '';
  40. var COND_DATA = '';
  41. var IS_SET = false;
  42.  
  43. var CURR_INT_INDEX = -1;
  44.  
  45.  
  46. var parser = '';
  47. var editor = '';
  48.  
  49. var name = '';         // the name of the condition
  50. var condition = '';    // the JS condition string
  51.  
  52. var autoName = '';     // whether to automatically name a condition
  53. var condData = '';     // the data structure representing the condition
  54. var isComplete = '';   // indicates if the condition is complete
  55.  
  56. var rTypeStore = '';   // stores the right-hand type
  57.  
  58. // layer and UI objects
  59. var exprList = '';       // the list of expressions
  60. var lSelLayer = '';      // Left Type layer
  61. var lSelPick = '';
  62. var lKoLayer = '';       // Left KO layer
  63. var lKoIntPick = '';
  64. var lKoElemPick = '';
  65. var lKoPropPick = '';
  66. var lDocLayer = '';      // Left Tag Layer
  67. var lDocTypePick = '';
  68. var lDocObjPick = '';
  69. var lDocPropEntry = ''
  70. var lJsLayer = '';       // Left JS Layer
  71. var lJsEntry = '';
  72.  
  73. var compLayer = '';
  74. var compPick = '';
  75.  
  76. var rSelLayer = '';      // Right Type layer
  77. var rSelPick = '';
  78. var rKoLayer = '';       // Right KO layer
  79. var rKoIntPick = '';
  80. var rKoElemPick = '';
  81. var rKoPropPick = '';
  82. var rDocLayer = '';      // Right Tag layer
  83. var rDocTypePick = '';
  84. var rDocObjPick = '';
  85. var rDocPropEntry = '';
  86. var rJsLayer = '';       // Right JS layer
  87. var rJsEntry = '';
  88. var rNumLayer = '';      // Right Num layer
  89. var rNumEntry = '';
  90. var rTextLayer = '';     // Right Text layer
  91. var rTextEntry = '';
  92. var rBoolLayer = '';     // Right Boolean layer
  93. var rBoolPick = '';
  94. var rOrdLayer = '';      // Right Ordinal layer
  95. var rOrdPick = '';
  96.  
  97. var boolOpLayer = '';
  98. var boolOpPick = '';
  99.  
  100.  
  101. //******************* API **********************
  102.  
  103. function commandButtons(){
  104.   return new Array(BTN_OK,"cmdOK()",
  105.                    BTN_Cancel,"cmdCancel()",
  106.                    BTN_Help,"displayHelp()");
  107. }
  108.  
  109. function cmdOK() {
  110.   if (applyCommand()) {
  111.     garbageCollect(true);
  112.     window.close();
  113.   }
  114. }
  115.  
  116. function cmdCancel() {
  117.   garbageCollect(true);
  118.   window.close();
  119. }
  120.  
  121. function applyCommand() {
  122.   var retVal = false,theList,newName;
  123.   if (!isComplete) {
  124.     alert(MSG_condIncomplete);
  125.   } else if (condData.length == 0) {
  126.     alert(MSG_noConditions);
  127.   } else {
  128.     // auto name the condition, if necessary
  129.     if (PROP_autoNameCondition && autoName) {
  130.       theList = editor.getExprList(condData);
  131.       newName = '';
  132.       for (i=0; i < theList.length && newName.length <= PREF_autoCondNameLength; i++)
  133.         newName += theList[i] + ((i+1 < theList.length) ? " " : "");
  134.       if (newName.length > PREF_autoCondNameLength)
  135.         newName = newName.substring(0, PREF_autoCondNameLength) + "...";
  136.       name = (newName) ? newName : LABEL_defaultCondName;
  137.       name = name.replace(/"/g, '');
  138.       name = name.replace(/'/g, '');
  139.     }
  140.   
  141.     condition = parser.getCondImage(condData);
  142.     
  143.     COND_NAME = name;
  144.     COND_DATA = condition;
  145.     IS_SET = true;
  146.     retVal = true;
  147.   }
  148.   return retVal;
  149. }
  150.  
  151. function inspectCommand(theName, theCondStr) {
  152.   name = (theName!=null) ? theName : '';
  153.   condition = (theCondStr!=null) ? theCondStr : '';
  154.   COND_NAME = name;
  155.   COND_DATA = condition;
  156.   IS_SET = false;
  157.   
  158.   setupControls();
  159. }
  160.  
  161.  
  162. function setupControls() {
  163.   parser = new PropParser();
  164.   editor = new PropEditor();
  165.  
  166.   // Create the controls
  167.   exprList = new ListControl('exprSelect');
  168.  
  169.   lSelLayer = findObject('leftSelector');
  170.   lSelPick = new PickList('theLeftKind');
  171.   lSelPick.setInfo(MENULIST_stdExprTypes, MENUDATA_stdExprTypes);
  172.  
  173.   lKoLayer = findObject('koLeftEdit');
  174.   lKoIntPick  = new PickList('theLeftInt');
  175.   lKoElemPick = new PickList('theLeftElem');
  176.   lKoPropPick = new PickList('theLeftProp');
  177.  
  178.   lDocLayer = findObject('docLeftEdit');
  179.   lDocTypePick  = new PickList('theLeftTagType');
  180.   lDocTypePick.setInfo(MENULIST_tagNames, MENUDATA_tagNames);
  181.   lDocObjPick = new PickList('theLeftTag');
  182.   lDocPropEntry = findObject('theLeftTagProp' , lDocLayer);
  183.  
  184.   lJsLayer = findObject('jsLeftEdit');
  185.   lJsEntry = findObject('theLeftJs' , lJsLayer);
  186.  
  187.   compLayer = findObject('operatorEdit');
  188.   compPick = new PickList('theOperator');
  189.   compPick.setInfo(MENULIST_allCompTypes, MENUDATA_allCompTypes);
  190.  
  191.   rSelLayer = findObject('rightSelector');
  192.   rSelPick = new PickList('theRightKind');
  193.   rSelPick.setInfo(MENULIST_allExprTypes, MENUDATA_allExprTypes);
  194.  
  195.   rKoLayer = findObject('koRightEdit');
  196.   rKoIntPick  = new PickList('theRightInt');
  197.   rKoElemPick = new PickList('theRightElem');
  198.   rKoPropPick = new PickList('theRightProp');
  199.  
  200.   rDocLayer = findObject('docRightEdit');
  201.   rDocTypePick  = new PickList('theRightTagType');
  202.   rDocTypePick.setInfo(MENULIST_tagNames, MENUDATA_tagNames);
  203.   rDocObjPick = new PickList('theRightTag');
  204.   rDocPropEntry = findObject('theRightTagProp' , rDocLayer);
  205.  
  206.   rJsLayer = findObject('jsRightEdit');
  207.   rJsEntry = findObject('theRightJs' , rJsLayer);
  208.  
  209.   rNumLayer = findObject('numRightEdit');
  210.   rNumEntry = findObject('theRightNum' , rNumLayer);
  211.  
  212.   rTextLayer = findObject('textRightEdit');
  213.   rTextEntry = findObject('theRightText' , rTextLayer);
  214.  
  215.   rBoolLayer = findObject('boolRightEdit');
  216.   rBoolPick = new PickList('theRightBool');
  217.   rBoolPick.setInfo(MENULIST_boolVals, MENUDATA_boolVals);
  218.  
  219.   rOrdLayer = findObject('ordRightEdit');
  220.   rOrdPick = new PickList('theRightOrd');
  221.  
  222.   boolOpLayer = findObject('boolOpSelector');
  223.   boolOpPick = new PickList('theBoolOp');
  224.   boolOpPick.setInfo(MENULIST_boolOps, MENUDATA_boolOps);
  225.  
  226.  
  227.   // Initialize the controls
  228.  
  229.   theObj=findObject('niceName');
  230.   theObj.value = removeExt(name);
  231.   autoName = (name.length == 0 || removeExt(name) == LABEL_defaultCondName);
  232.  
  233.   editor.init();
  234.   if (CURR_INT_INDEX != -1)
  235.     editor.intList.defIndex = CURR_INT_INDEX;
  236.  
  237.   with (editor.intList) {
  238.     lKoIntPick.setInfo(names, ids, defIndex);
  239.     rKoIntPick.setInfo(names, ids, defIndex);
  240.   }
  241.  
  242.   rTypeStore = new Array();
  243.  
  244.   if (condition || !PROP_autoAddCondition) {
  245.     // Parse the condition
  246.     condData = parser.getCondData(condition);
  247.     editor.isValidCond(condData, true);
  248.  
  249.     // display the expression list.
  250.     showExprList();
  251.     exprList.setIndex(0);
  252.  
  253.     // now update the editor displays
  254.     updateEditors();
  255.   } else {
  256.     // Add a default condition
  257.     condData = new Array();
  258.     condData[0] = parser.newExprNode();
  259.     condData[0].left.type = parser.koType;
  260.     condData[0].right.type = parser.boolType;
  261.     condData[0].right.bool = "true";
  262.  
  263.     // update the display
  264.     updateEditors(true,0); // pick default values for new item
  265.     showExprList();      // now show
  266.     exprList.setIndex(0);
  267.   }
  268. }
  269.  
  270.  
  271. //***************** LOCAL FUNCTIONS  ******************
  272.  
  273. function initializeUI() {
  274.   document.theForm.niceName.focus();
  275.   document.theForm.niceName.select();
  276. }
  277.  
  278. function updateUI(theItemName) {
  279.   var theObj;
  280.  
  281.   if (theItemName == 'niceName') {
  282.     theObj = findObject(theItemName);
  283.     if (removeExt(name) != theObj.value) {
  284.       name =  theObj.value;
  285.       name = name.replace(/"/g, '');
  286.       name = name.replace(/'/g, '');
  287.       theObj.value = name;
  288.       autoName = (name.length == 0 || removeExt(name) == LABEL_defaultCondName);
  289.     }
  290.  
  291.   } else if (theItemName == 'exprAdd') {
  292.     var addIndex = (condData.length == 0) ? 0 : exprList.index+1;
  293.     // create the node
  294.     var newNode = parser.newExprNode();
  295.     newNode.left.type = parser.koType;
  296.     newNode.right.type = parser.boolType;
  297.     newNode.right.bool = "true";
  298.     // insert the node in condData
  299.     condData.splice(addIndex, 0, newNode);
  300.     // update the display
  301.     updateEditors(true, addIndex); // pick default values for new item
  302.     showExprList();                 // now show
  303.     exprList.setIndex(addIndex);
  304.  
  305.   } else if (theItemName == 'exprDel') {
  306.     if (condData.length == 1) {
  307.       alert(MSG_cantDeleteLastExpr);
  308.       return;
  309.     }
  310.     condData.splice(exprList.index, 1);
  311.     if (exprList.index >= condData.length)
  312.       exprList.setIndex(condData.length-1);
  313.     showExprList();
  314.     updateEditors();
  315.  
  316.   } else if (theItemName == 'exprSelect') {
  317.     exprList.refresh();
  318.     updateEditors();
  319.  
  320.   } else if (theItemName == 'theLeftKind') {
  321.     lSelPick.change();
  322.     // store the right-hand type for the current left-hand type
  323.     with (condData[exprList.index]) {
  324.       rTypeStore[left.type] = (right.isSegment) ? 'segment' : right.type;
  325.       if (lSelPick.id == 'segment') {
  326.         left.type = parser.koType;
  327.         left.isSegment = true;
  328.         left.propIsFn = true;
  329.         if (left.propArgs.length == 0) {
  330.           left.propArgs[0] = parser.newOperNode();
  331.           left.propArgs[0].type = parser.strType;
  332.         }
  333.       } else {
  334.         left.type = lSelPick.id;
  335.         left.isSegment = false;
  336.         left.propIsFn = false;
  337.       }
  338.       right.type = (rTypeStore[left.type]) ? rTypeStore[left.type] : parser.boolType;
  339.       right.isOrdinal = false;
  340.       right.isSegment = false;
  341.       right.propIsFn = false;
  342.       if (right.type == 'segment') {
  343.         right.type = parser.koType;
  344.         right.isSegment = true;
  345.         right.propIsFn = true;
  346.         if (right.propArgs.length == 0) {
  347.           right.propArgs[0] = parser.newOperNode();
  348.           right.propArgs[0].type = parser.strType;
  349.         }
  350.       }
  351.     }
  352.     updateEditors(true);
  353.     updateExprList();
  354.     lSelPick.list.object.focus();
  355.  
  356.   } else if (theItemName == 'theLeftInt') {
  357.     lKoIntPick.change();
  358.     condData[exprList.index].left.interaction = lKoIntPick.id.value;
  359.     updateEditors(true);
  360.     updateExprList();
  361.     lKoIntPick.list.object.focus();
  362.   } else if (theItemName == 'theLeftElem') {
  363.     lKoElemPick.change();
  364.     with (condData[exprList.index]) {
  365.       if (!left.isSegment) {
  366.         left.element = lKoElemPick.id.elem;
  367.         left.choice = lKoElemPick.id.choice;
  368.       } else {
  369.         left.propArgs[0].text = lKoElemPick.id;
  370.       }
  371.     }
  372.     updateEditors(true);
  373.     updateExprList();
  374.     lKoElemPick.list.object.focus();
  375.   } else if (theItemName == 'theLeftProp') {
  376.     lKoPropPick.change();
  377.     condData[exprList.index].left.property = lKoPropPick.id.value;
  378.     updateEditors(true);
  379.     updateExprList();
  380.     lKoPropPick.list.object.focus();
  381.  
  382.   } else if (theItemName == 'theLeftTagType') {
  383.     lDocTypePick.change();
  384.     condData[exprList.index].left.objType = lDocTypePick.id;
  385.     updateEditors();
  386.     updateExprList();
  387.     lDocTypePick.list.object.focus();
  388.   } else if (theItemName == 'theLeftTag') {
  389.     lDocObjPick.change();
  390.     condData[exprList.index].left.objName = lDocObjPick.id.value;
  391.     updateExprList();
  392.     lDocObjPick.list.object.focus();
  393.   } else if (theItemName == 'theLeftTagProp') {
  394.     condData[exprList.index].left.objProp = lDocPropEntry.value;
  395.     updateExprList();
  396.  
  397.   } else if (theItemName == 'theLeftJs') {
  398.     condData[exprList.index].left.script = parser.makeValidJSCond(lJsEntry.value);
  399.     updateExprList();
  400.  
  401.   } else if (theItemName == 'theOperator') {
  402.     compPick.change();
  403.     condData[exprList.index].operator = compPick.id;
  404.     updateExprList();
  405.     compPick.list.object.focus();
  406.  
  407.   } else if (theItemName == 'theRightKind') {
  408.     rSelPick.change();
  409.     with (condData[exprList.index]) {
  410.       right.type = rSelPick.id;
  411.       right.isOrdinal = false;
  412.       right.isSegment = false;
  413.       right.propIsFn = false;
  414.       if (rSelPick.id == 'ordinal') {  // selected an ordinal
  415.         right.type = lKoPropPick.id.type;
  416.         right.isOrdinal = true;
  417.       } else if (rSelPick.id == 'segment') { // selected an AM property
  418.         right.type = parser.koType;
  419.         right.isSegment = true;
  420.         right.propIsFn = true;
  421.         if (right.propArgs.length == 0) {
  422.           right.propArgs[0] = parser.newOperNode();
  423.           right.propArgs[0].type = parser.strType;
  424.         }
  425.       }
  426.     }
  427.     updateEditors();
  428.     updateExprList();
  429.     rSelPick.list.object.focus();
  430.  
  431.   } else if (theItemName == 'theRightInt') {
  432.     rKoIntPick.change();
  433.     condData[exprList.index].right.interaction = rKoIntPick.id.value;
  434.     updateEditors();
  435.     updateExprList();
  436.     rKoIntPick.list.object.focus();
  437.   } else if (theItemName == 'theRightElem') {
  438.     rKoElemPick.change();
  439.     with (condData[exprList.index]) {
  440.       if (!right.isSegment) {
  441.         right.element = rKoElemPick.id.elem;
  442.         right.choice = rKoElemPick.id.choice;
  443.       } else {
  444.         right.propArgs[0].text = rKoElemPick.id;
  445.       }
  446.     }
  447.     updateEditors();
  448.     updateExprList();
  449.     rKoElemPick.list.object.focus();
  450.   } else if (theItemName == 'theRightProp') {
  451.     rKoPropPick.change();
  452.     condData[exprList.index].right.property = rKoPropPick.id.value;
  453.     updateExprList();
  454.     rKoPropPick.list.object.focus();
  455.  
  456.   } else if (theItemName == 'theRightTagType') {
  457.     rDocTypePick.change();
  458.     condData[exprList.index].right.objType = rDocTypePick.id;
  459.     updateEditors();
  460.     updateExprList();
  461.     rDocTypePick.list.object.focus();
  462.   } else if (theItemName == 'theRightTag') {
  463.     rDocObjPick.change();
  464.     condData[exprList.index].right.objName = rDocObjPick.id.value;
  465.     updateExprList();
  466.     rDocObjPick.list.object.focus();
  467.   } else if (theItemName == 'theRightTagProp') {
  468.     condData[exprList.index].right.objProp = rDocPropEntry.value;
  469.     updateExprList();
  470.  
  471.   } else if (theItemName == 'theRightJs') {
  472.     condData[exprList.index].right.script = parser.makeValidJSCond(rJsEntry.value);
  473.     updateExprList();
  474.  
  475.   } else if (theItemName == 'theRightNum') {
  476.     if (isNumber(rNumEntry.value)) {
  477.       condData[exprList.index].right.number = rNumEntry.value;
  478.       updateExprList();
  479.     } else {
  480.       alert(MSG_numbersOnly);
  481.       rNumEntry.value = condData[exprList.index].right.number;
  482.     }
  483.  
  484.   } else if (theItemName == 'theRightText') {
  485.     condData[exprList.index].right.text = rTextEntry.value;
  486.     updateExprList();
  487.  
  488.   } else if (theItemName == 'theRightBool') {
  489.     rBoolPick.change();
  490.     condData[exprList.index].right.bool = rBoolPick.id;
  491.     updateExprList();
  492.     rBoolPick.list.object.focus();
  493.  
  494.   } else if (theItemName == 'theRightOrd') {
  495.     rOrdPick.change();
  496.     // set the appropriate value for the current type
  497.     if (condData[exprList.index].right.type == parser.strType)
  498.       condData[exprList.index].right.text = rOrdPick.id;
  499.     else if (condData[exprList.index].right.type == parser.numType)
  500.       condData[exprList.index].right.number = rOrdPick.id;
  501.     else if (condData[exprList.index].right.type == parser.jsType)
  502.       condData[exprList.index].right.script = rOrdPick.id;
  503.     updateExprList();
  504.     rOrdPick.list.object.focus();
  505.  
  506.   } else if (theItemName == 'theBoolOp') {
  507.     boolOpPick.change();
  508.     condData[exprList.index].boolOp = boolOpPick.id;
  509.     updateExprList();
  510.     boolOpPick.list.object.focus();
  511.   }
  512. }
  513.  
  514.  
  515. //Shows the expression list display.
  516. //
  517. function showExprList() {
  518.   var theList = '';
  519.  
  520.   theList = editor.getExprList(condData);
  521.   isComplete = editor.isComplete;
  522.   exprList.setAll(theList);
  523. }
  524.  
  525.  
  526. //Updates the current expression
  527. //
  528. function updateExprList() {
  529.   var theList = '', expr;
  530.   var theIndex = exprList.index;
  531.   
  532.   theList = editor.getExprList(condData);
  533.   isComplete = editor.isComplete;
  534.   
  535.   // convert HTML escape sequences
  536.   expr = theList[theIndex];
  537.   expr = expr.replace(/>[;]?/g, ">");
  538.   expr = expr.replace(/<[;]?/g, "<");
  539.   
  540.   exprList.set(expr);
  541. }
  542.  
  543.  
  544. function updateEditors(changeRightType, index) {
  545.   index = (index != null) ? index : exprList.index;
  546.   changeRightType = (changeRightType != null) ? changeRightType : false;
  547.  
  548.   if (index < 0 || index >= condData.length) {
  549.     var emptyNode = parser.newExprNode();
  550.     updateExpression(emptyNode);
  551.   } else
  552.     updateExpression(condData[index], changeRightType);
  553. }
  554.  
  555.  
  556. function updateExpression(theExprNode, changeRightType) {
  557.   with (theExprNode) {
  558.  
  559.     if (left.type != parser.noType) {
  560.       lSelLayer.visibility = "inherit";
  561.       if (left.isSegment)
  562.         lSelPick.pickValue('segment');
  563.       else
  564.         lSelPick.pickValue(left.type);
  565.     } else
  566.       lSelLayer.visibility = "hidden";
  567.  
  568.  
  569.     editor.updateKObject(left, lKoLayer, lKoIntPick, lKoElemPick, lKoPropPick, false);
  570.     editor.updateTag(left, lDocLayer, lDocTypePick, lDocObjPick, lDocPropEntry);
  571.     editor.updateEntry(parser.jsType, left, lJsLayer, lJsEntry, left.script);
  572.  
  573.     if (changeRightType) { // set the right operand based on the property type
  574.       if (left.type == parser.koType) {
  575.         if (right.type != parser.koType && right.type != parser.tagType) {
  576.           right.type = lKoPropPick.id.type;
  577.           right.isOrdinal = (lKoPropPick.id.ordValues) ? true : false;
  578.         }
  579.       }
  580.     }
  581.  
  582.     if (left.type == parser.jsType) right.type = parser.noType;
  583.  
  584.     // set the operator and right selection list,
  585.     //  based on the property type
  586.     if (left.type == parser.koType) {
  587.       if (lKoPropPick.id.ordValues) {
  588.         compPick.setInfo(MENULIST_ordCompTypes, MENUDATA_ordCompTypes);
  589.         rSelPick.setInfo(MENULIST_ordExprTypes, MENUDATA_ordExprTypes);
  590.       } else if (lKoPropPick.id.type == parser.strType) {
  591.         compPick.setInfo(MENULIST_strCompTypes, MENUDATA_strCompTypes);
  592.         rSelPick.setInfo(MENULIST_strExprTypes, MENUDATA_strExprTypes);
  593.       } else if (lKoPropPick.id.type == parser.numType) {
  594.         compPick.setInfo(MENULIST_numCompTypes, MENUDATA_numCompTypes);
  595.         rSelPick.setInfo(MENULIST_numExprTypes, MENUDATA_numExprTypes);
  596.       } else if (lKoPropPick.id.type == parser.boolType) {
  597.         compPick.setInfo(MENULIST_ordCompTypes, MENUDATA_ordCompTypes);
  598.         rSelPick.setInfo(MENULIST_boolExprTypes, MENUDATA_boolExprTypes);
  599.       } else {
  600.         compPick.setInfo(MENULIST_allCompTypes, MENUDATA_allCompTypes);
  601.         rSelPick.setInfo(MENULIST_allExprTypes, MENUDATA_allExprTypes);
  602.       }
  603.     } else {
  604.       compPick.setInfo(MENULIST_allCompTypes, MENUDATA_allCompTypes);
  605.       rSelPick.setInfo(MENULIST_allExprTypes, MENUDATA_allExprTypes);
  606.     }
  607.  
  608.     if (right.type != parser.noType) {
  609.       compLayer.visibility = "inherit";
  610.       compPick.pickValue(operator);
  611.       operator = compPick.id;
  612.     } else
  613.       compLayer.visibility = "hidden";
  614.  
  615.     if (right.type != parser.noType) {
  616.       rSelLayer.visibility = "inherit";
  617.       if (right.isOrdinal)
  618.         rSelPick.pickValue('ordinal');
  619.       else if (right.isSegment)
  620.         rSelPick.pickValue('segment');
  621.       else
  622.         rSelPick.pickValue(right.type);
  623.     } else
  624.       rSelLayer.visibility = "hidden";
  625.  
  626.     editor.updateKObject(right, rKoLayer, rKoIntPick, rKoElemPick, rKoPropPick, false);
  627.     editor.updateTag(right, rDocLayer, rDocTypePick, rDocObjPick, rDocPropEntry);
  628.     editor.updateEntry(parser.jsType, right, rJsLayer, rJsEntry, right.script);
  629.     editor.updateEntry(parser.numType, right, rNumLayer, rNumEntry, right.number);
  630.     editor.updateEntry(parser.strType, right, rTextLayer, rTextEntry, right.text);
  631.     editor.updateBoolean(right, rBoolLayer, rBoolPick);
  632.     editor.updateOrdinal(right, rOrdLayer, rOrdPick, lKoPropPick.id);
  633.  
  634.     if (left.type != parser.noType) {
  635.       boolOpLayer.visibility = "inherit";
  636.       boolOpPick.pickValue(boolOp);
  637.       boolOp = boolOpPick.id;
  638.     } else
  639.       boolOpLayer.visibility = "hidden";
  640.   }
  641. }
  642.